feat(parquet): support object versions in ParquetObjectReader - #9753
feat(parquet): support object versions in ParquetObjectReader#9753ClSlaid wants to merge 1 commit into
Conversation
Code: add with_version and use ObjectStore::get_opts for suffix, single-range, and multi-range reads when a version is set. Test: add a self-contained regression test using a temporary local object store. Fix: ensure parquet metadata and data are read from the requested object revision instead of the latest object state.
|
/cc @yeya24 PTAL. |
| self.spawn(|store, path| { | ||
| async move { | ||
| let resp = store.get_opts(path, options).await?; | ||
| Ok::<_, ParquetError>(resp.bytes().await?) | ||
| } | ||
| .boxed() |
There was a problem hiding this comment.
Why do we need the async closure here? Can we simplify this to something like this
store.get_opts(path, options).await.boxed()| impl AsyncFileReader for ParquetObjectReader { | ||
| fn get_bytes(&mut self, range: Range<u64>) -> BoxFuture<'_, Result<Bytes>> { | ||
| self.spawn(|store, path| store.get_range(path, range).boxed()) | ||
| if self.version.is_some() { |
There was a problem hiding this comment.
Maybe I am missing something but the version is not passed to the options... So how does it make it into the request?
I also think it would be easier to read this code if you use the same async closure and just changed the ptions
let mut options = self.get_opts(Some(GetRange::from(range)));
if let Some(version) = self.version.as_ref() {
options = options.woth_version(version);
}
self.spawn(|store, path| store.get_opts(path, options).boxed())| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_simple_with_version() { |
There was a problem hiding this comment.
How do these very the version is passed through? Do they fail if you revert the code changes?
|
Marking as draft as I think this PR is no longer waiting on feedback and I am trying to make it easier to find PRs in need of review. Please mark it as ready for review when it is ready for another look |
|
I'm moving to a new apartment this weekend, I'll mark all my pending PRs draft then. |
|
Thank you (good luck with the move!) |
|
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days. |
Summary
ParquetObjectReader::with_versionand useObjectStore::get_optsfor suffix, single-range, and multi-range reads when a version is specifiedTesting
cargo test -p parquet --features object_store,arrow test_simple_with_version -- --nocaptureFix [Parquet] Support version in ParquetObjectReader #8568